import java.util.Scanner;

public class Test8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Circle c1 = new Circle();
        System.out.println(c1);
        System.out.println("c1:area=" + c1.gerArea());
        Circle c2 = new Circle();
        System.out.println(c2);
        int radius1 = sc.nextInt();
        c2.setRadius(radius1);
        System.out.println(c2);
        System.out.println("c2:area=" + c2.gerArea());
        int radius2 = sc.nextInt();
        Circle c3 = new Circle(radius2);
        System.out.println(c3);
        System.out.println("c3:area=" + c3.gerArea());
    }
}

class Circle {
    private int radius;

    public Circle() {
        this.radius = 2;
        System.out.println("this is a constructor");
    }

    public Circle(int radius) {
        if (radius <= 0) {
            this.radius = 2;
        }else {
            this.radius = radius;
        }
        System.out.println("this is a constructor with para");
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        if (radius <= 0) {
            this.radius = 2;
        }else {
            this.radius = radius;
        }
    }

    @Override
    public String toString() {
        return "Circle [" +
                "radius=" + radius +
                ']';
    }

    public int gerArea(){
        return (int)(Math.PI * radius * radius);
    }
}
